package com.zyf.school.manager.dao;

import com.zyf.school.manager.domain.Area;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
@Component(value = "areaDao")
public interface AreaDao {
    //插入数据
    @Insert("insert into area(tel,code,name,state,begintime,endtime,parent_id) values(#{tel},#{code},#{name},#{state},#{begintime},#{endtime},#{parentId})")
    void insert(Area area);

    //查询数据
    @Select("select * from area where tel = #{tel}")
    List<Area> queryByTel(String tel);

    //查询数据
    @Select("select * from area where parent_tel = #{tel}")
    List<Area> queryByParentTel(String tel);
}
